]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
search: Make overview application search results grid RTL aware
authorKhalid Abu Shawarib <kas@gnome.org>
Mon, 25 Aug 2025 18:08:54 +0000 (21:08 +0300)
committerMarge Bot <marge-bot@gnome.org>
Thu, 11 Sep 2025 10:45:57 +0000 (10:45 +0000)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3851>

js/ui/search.js

index 3204ea0b628c0164704284a63f4a5da18d677693..d7f1df3949ac731d478acc1a0592e5cdde53e921 100644 (file)
@@ -399,6 +399,7 @@ const GridSearchResultsLayout = GObject.registerClass({
 
     vfunc_allocate(container, box) {
         const width = box.get_width();
+        const ltr = container.get_text_direction() !== Clutter.TextDirection.RTL;
 
         const childBox = new Clutter.ActorBox();
         let accumulatedWidth = 0;
@@ -416,7 +417,11 @@ const GridSearchResultsLayout = GObject.registerClass({
             const [childWidth] = child.get_preferred_width(-1);
             const [childHeight] = child.get_preferred_height(-1);
 
-            childBox.set_origin(accumulatedWidth, 0);
+            if (ltr)
+                childBox.set_origin(accumulatedWidth, 0);
+            else
+                childBox.set_origin(width - accumulatedWidth - childWidth, 0);
+
             accumulatedWidth += childWidth;
 
             if (accumulatedWidth <= width)